<?php
require('config.php');

        
        $phone=$_REQUEST['phone'];
        $content=$_REQUEST['content'];
        if(isset($_REQUEST['user_id']))
        {
		$user_id=$_REQUEST['user_id'];
		$sql="INSERT INTO ".$oto."_suggest (`userId`,`phone`,`content`) VALUES ('$user_id','$phone','$content')";
        	$result=$db->query($sql);
        	if($result)
        	{
        		$data[0]['pan']="true";
        	}
        	else
        	{
        		$data[0]['pan']="false";
        	}
			echo json_encode($data);
        }
        else
        {
		$sql="INSERT INTO ".$oto."_suggest (`phone`,`content`) VALUES ('$phone','$content')";
        	$result=$db->query($sql);
        	if($result)
        	{
        		$data[0]['pan']="true";
        	}
        	else
        	{
        		$data[0]['pan']="false";
        	}
			echo json_encode($data);
        }
		
?>